package reamodel.diagram.navigator;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.viewers.ITreePathLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonLabelProvider;

import reamodel.REAModel;
import reamodel.diagram.edit.parts.CommitmentAgentEditPart;
import reamodel.diagram.edit.parts.CommitmentResourceEditPart;
import reamodel.diagram.edit.parts.DecrementCommitmentEditPart;
import reamodel.diagram.edit.parts.DecrementCommitmentFulfillEditPart;
import reamodel.diagram.edit.parts.DecrementCommitmentNameEditPart;
import reamodel.diagram.edit.parts.DecrementCommitmentSpecifyEditPart;
import reamodel.diagram.edit.parts.DecrementEconomicEventEditPart;
import reamodel.diagram.edit.parts.DecrementEconomicEventNameEditPart;
import reamodel.diagram.edit.parts.DecrementEconomicEventTypeEditPart;
import reamodel.diagram.edit.parts.DecrementEconomicEventTypeNameEditPart;
import reamodel.diagram.edit.parts.DecrementEconomicEventTypeTypifyEditPart;
import reamodel.diagram.edit.parts.DualityLabelEditPart;
import reamodel.diagram.edit.parts.DualityTypeLabelEditPart;
import reamodel.diagram.edit.parts.EconomicAgentEditPart;
import reamodel.diagram.edit.parts.EconomicAgentNameEditPart;
import reamodel.diagram.edit.parts.EconomicAgentTypeEditPart;
import reamodel.diagram.edit.parts.EconomicAgentTypeNameEditPart;
import reamodel.diagram.edit.parts.EconomicAgentTypeTypifyEditPart;
import reamodel.diagram.edit.parts.EconomicResourceEditPart;
import reamodel.diagram.edit.parts.EconomicResourceNameEditPart;
import reamodel.diagram.edit.parts.EconomicResourceTypeEditPart;
import reamodel.diagram.edit.parts.EconomicResourceTypeNameEditPart;
import reamodel.diagram.edit.parts.EconomicResourceTypeTypifyEditPart;
import reamodel.diagram.edit.parts.FulfillLabel2EditPart;
import reamodel.diagram.edit.parts.FulfillLabelEditPart;
import reamodel.diagram.edit.parts.IncrementCommitmentEditPart;
import reamodel.diagram.edit.parts.IncrementCommitmentFulfillEditPart;
import reamodel.diagram.edit.parts.IncrementCommitmentNameEditPart;
import reamodel.diagram.edit.parts.IncrementCommitmentReciprocityEditPart;
import reamodel.diagram.edit.parts.IncrementCommitmentSpecifyEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventDualityEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventNameEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventTypeDualityTypeEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventTypeEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventTypeNameEditPart;
import reamodel.diagram.edit.parts.IncrementEconomicEventTypeTypifyEditPart;
import reamodel.diagram.edit.parts.InflowEditPart;
import reamodel.diagram.edit.parts.InflowNameEditPart;
import reamodel.diagram.edit.parts.InflowTypeEditPart;
import reamodel.diagram.edit.parts.InflowTypeNameEditPart;
import reamodel.diagram.edit.parts.OutflowEditPart;
import reamodel.diagram.edit.parts.OutflowNameEditPart;
import reamodel.diagram.edit.parts.OutflowTypeEditPart;
import reamodel.diagram.edit.parts.OutflowTypeNameEditPart;
import reamodel.diagram.edit.parts.ProvideParticipationEditPart;
import reamodel.diagram.edit.parts.ProvideParticipationNameEditPart;
import reamodel.diagram.edit.parts.REAModelEditPart;
import reamodel.diagram.edit.parts.ReceiveParticipationEditPart;
import reamodel.diagram.edit.parts.ReceiveParticipationNameEditPart;
import reamodel.diagram.edit.parts.ReciprocityLabelEditPart;
import reamodel.diagram.edit.parts.SpecifyLabel2EditPart;
import reamodel.diagram.edit.parts.SpecifyLabel3EditPart;
import reamodel.diagram.edit.parts.SpecifyLabel4EditPart;
import reamodel.diagram.edit.parts.SpecifyLabelEditPart;
import reamodel.diagram.edit.parts.TypifyLabel2EditPart;
import reamodel.diagram.edit.parts.TypifyLabel3EditPart;
import reamodel.diagram.edit.parts.TypifyLabel4EditPart;
import reamodel.diagram.edit.parts.TypifyLabelEditPart;
import reamodel.diagram.part.REAmetamodelDiagramEditorPlugin;
import reamodel.diagram.part.REAmetamodelVisualIDRegistry;
import reamodel.diagram.providers.REAmetamodelElementTypes;
import reamodel.diagram.providers.REAmetamodelParserProvider;

/**
 * @generated
 */
public class REAmetamodelNavigatorLabelProvider extends LabelProvider implements
		ICommonLabelProvider, ITreePathLabelProvider {

	/**
	 * @generated
	 */
	static {
		REAmetamodelDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put(
						"Navigator?UnknownElement", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
		REAmetamodelDiagramEditorPlugin
				.getInstance()
				.getImageRegistry()
				.put(
						"Navigator?ImageNotFound", ImageDescriptor.getMissingImageDescriptor()); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	public void updateLabel(ViewerLabel label, TreePath elementPath) {
		Object element = elementPath.getLastSegment();
		if (element instanceof REAmetamodelNavigatorItem
				&& !isOwnView(((REAmetamodelNavigatorItem) element).getView())) {
			return;
		}
		label.setText(getText(element));
		label.setImage(getImage(element));
	}

	/**
	 * @generated
	 */
	public Image getImage(Object element) {
		if (element instanceof REAmetamodelNavigatorGroup) {
			REAmetamodelNavigatorGroup group = (REAmetamodelNavigatorGroup) element;
			return REAmetamodelDiagramEditorPlugin.getInstance()
					.getBundledImage(group.getIcon());
		}

		if (element instanceof REAmetamodelNavigatorItem) {
			REAmetamodelNavigatorItem navigatorItem = (REAmetamodelNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return super.getImage(element);
			}
			return getImage(navigatorItem.getView());
		}

		return super.getImage(element);
	}

	/**
	 * @generated
	 */
	public Image getImage(View view) {
		switch (REAmetamodelVisualIDRegistry.getVisualID(view)) {
		case REAModelEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Diagram?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?REAModel", REAmetamodelElementTypes.REAModel_79); //$NON-NLS-1$
		case EconomicResourceTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?EconomicResourceType", REAmetamodelElementTypes.EconomicResourceType_1001); //$NON-NLS-1$
		case EconomicAgentTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?EconomicAgentType", REAmetamodelElementTypes.EconomicAgentType_1002); //$NON-NLS-1$
		case DecrementEconomicEventTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?DecrementEconomicEventType", REAmetamodelElementTypes.DecrementEconomicEventType_1003); //$NON-NLS-1$
		case IncrementEconomicEventTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementEconomicEventType", REAmetamodelElementTypes.IncrementEconomicEventType_1004); //$NON-NLS-1$
		case EconomicAgentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?EconomicAgent", REAmetamodelElementTypes.EconomicAgent_1005); //$NON-NLS-1$
		case EconomicResourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?EconomicResource", REAmetamodelElementTypes.EconomicResource_1006); //$NON-NLS-1$
		case DecrementEconomicEventEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?DecrementEconomicEvent", REAmetamodelElementTypes.DecrementEconomicEvent_1007); //$NON-NLS-1$
		case IncrementEconomicEventEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementEconomicEvent", REAmetamodelElementTypes.IncrementEconomicEvent_1008); //$NON-NLS-1$
		case IncrementCommitmentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementCommitment", REAmetamodelElementTypes.IncrementCommitment_1009); //$NON-NLS-1$
		case DecrementCommitmentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?TopLevelNode?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?DecrementCommitment", REAmetamodelElementTypes.DecrementCommitment_1010); //$NON-NLS-1$
		case EconomicResourceTypeTypifyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?EconomicResourceType?typify", REAmetamodelElementTypes.EconomicResourceTypeTypify_3001); //$NON-NLS-1$
		case OutflowEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?Outflow", REAmetamodelElementTypes.Outflow_3002); //$NON-NLS-1$
		case InflowEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?Inflow", REAmetamodelElementTypes.Inflow_3003); //$NON-NLS-1$
		case DecrementEconomicEventTypeTypifyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?DecrementEconomicEventType?typify", REAmetamodelElementTypes.DecrementEconomicEventTypeTypify_3004); //$NON-NLS-1$
		case IncrementEconomicEventTypeTypifyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementEconomicEventType?typify", REAmetamodelElementTypes.IncrementEconomicEventTypeTypify_3005); //$NON-NLS-1$
		case OutflowTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?OutflowType", REAmetamodelElementTypes.OutflowType_3006); //$NON-NLS-1$
		case InflowTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?InflowType", REAmetamodelElementTypes.InflowType_3007); //$NON-NLS-1$
		case EconomicAgentTypeTypifyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?EconomicAgentType?typify", REAmetamodelElementTypes.EconomicAgentTypeTypify_3008); //$NON-NLS-1$
		case ReceiveParticipationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?ReceiveParticipation", REAmetamodelElementTypes.ReceiveParticipation_3009); //$NON-NLS-1$
		case ProvideParticipationEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?ProvideParticipation", REAmetamodelElementTypes.ProvideParticipation_3010); //$NON-NLS-1$
		case IncrementEconomicEventDualityEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementEconomicEvent?duality", REAmetamodelElementTypes.IncrementEconomicEventDuality_3011); //$NON-NLS-1$
		case IncrementEconomicEventTypeDualityTypeEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementEconomicEventType?dualityType", REAmetamodelElementTypes.IncrementEconomicEventTypeDualityType_3012); //$NON-NLS-1$
		case CommitmentAgentEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?Commitment?agent", REAmetamodelElementTypes.CommitmentAgent_3013); //$NON-NLS-1$
		case CommitmentResourceEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?Commitment?resource", REAmetamodelElementTypes.CommitmentResource_3014); //$NON-NLS-1$
		case IncrementCommitmentFulfillEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementCommitment?fulfill", REAmetamodelElementTypes.IncrementCommitmentFulfill_3015); //$NON-NLS-1$
		case DecrementCommitmentFulfillEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?DecrementCommitment?fulfill", REAmetamodelElementTypes.DecrementCommitmentFulfill_3016); //$NON-NLS-1$
		case IncrementCommitmentReciprocityEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementCommitment?reciprocity", REAmetamodelElementTypes.IncrementCommitmentReciprocity_3017); //$NON-NLS-1$
		case DecrementCommitmentSpecifyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?DecrementCommitment?specify", REAmetamodelElementTypes.DecrementCommitmentSpecify_3018); //$NON-NLS-1$
		case IncrementCommitmentSpecifyEditPart.VISUAL_ID:
			return getImage(
					"Navigator?Link?http://reamodeller.googlecode.com/svn/trunk/REAModeller/model/REAmetamodel.ecore?IncrementCommitment?specify", REAmetamodelElementTypes.IncrementCommitmentSpecify_3019); //$NON-NLS-1$
		}
		return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
	}

	/**
	 * @generated
	 */
	private Image getImage(String key, IElementType elementType) {
		ImageRegistry imageRegistry = REAmetamodelDiagramEditorPlugin
				.getInstance().getImageRegistry();
		Image image = imageRegistry.get(key);
		if (image == null && elementType != null
				&& REAmetamodelElementTypes.isKnownElementType(elementType)) {
			image = REAmetamodelElementTypes.getImage(elementType);
			imageRegistry.put(key, image);
		}

		if (image == null) {
			image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
			imageRegistry.put(key, image);
		}
		return image;
	}

	/**
	 * @generated
	 */
	public String getText(Object element) {
		if (element instanceof REAmetamodelNavigatorGroup) {
			REAmetamodelNavigatorGroup group = (REAmetamodelNavigatorGroup) element;
			return group.getGroupName();
		}

		if (element instanceof REAmetamodelNavigatorItem) {
			REAmetamodelNavigatorItem navigatorItem = (REAmetamodelNavigatorItem) element;
			if (!isOwnView(navigatorItem.getView())) {
				return null;
			}
			return getText(navigatorItem.getView());
		}

		return super.getText(element);
	}

	/**
	 * @generated
	 */
	public String getText(View view) {
		if (view.getElement() != null && view.getElement().eIsProxy()) {
			return getUnresolvedDomainElementProxyText(view);
		}
		switch (REAmetamodelVisualIDRegistry.getVisualID(view)) {
		case REAModelEditPart.VISUAL_ID:
			return getREAModel_79Text(view);
		case EconomicResourceTypeEditPart.VISUAL_ID:
			return getEconomicResourceType_1001Text(view);
		case EconomicAgentTypeEditPart.VISUAL_ID:
			return getEconomicAgentType_1002Text(view);
		case DecrementEconomicEventTypeEditPart.VISUAL_ID:
			return getDecrementEconomicEventType_1003Text(view);
		case IncrementEconomicEventTypeEditPart.VISUAL_ID:
			return getIncrementEconomicEventType_1004Text(view);
		case EconomicAgentEditPart.VISUAL_ID:
			return getEconomicAgent_1005Text(view);
		case EconomicResourceEditPart.VISUAL_ID:
			return getEconomicResource_1006Text(view);
		case DecrementEconomicEventEditPart.VISUAL_ID:
			return getDecrementEconomicEvent_1007Text(view);
		case IncrementEconomicEventEditPart.VISUAL_ID:
			return getIncrementEconomicEvent_1008Text(view);
		case IncrementCommitmentEditPart.VISUAL_ID:
			return getIncrementCommitment_1009Text(view);
		case DecrementCommitmentEditPart.VISUAL_ID:
			return getDecrementCommitment_1010Text(view);
		case EconomicResourceTypeTypifyEditPart.VISUAL_ID:
			return getEconomicResourceTypeTypify_3001Text(view);
		case OutflowEditPart.VISUAL_ID:
			return getOutflow_3002Text(view);
		case InflowEditPart.VISUAL_ID:
			return getInflow_3003Text(view);
		case DecrementEconomicEventTypeTypifyEditPart.VISUAL_ID:
			return getDecrementEconomicEventTypeTypify_3004Text(view);
		case IncrementEconomicEventTypeTypifyEditPart.VISUAL_ID:
			return getIncrementEconomicEventTypeTypify_3005Text(view);
		case OutflowTypeEditPart.VISUAL_ID:
			return getOutflowType_3006Text(view);
		case InflowTypeEditPart.VISUAL_ID:
			return getInflowType_3007Text(view);
		case EconomicAgentTypeTypifyEditPart.VISUAL_ID:
			return getEconomicAgentTypeTypify_3008Text(view);
		case ReceiveParticipationEditPart.VISUAL_ID:
			return getReceiveParticipation_3009Text(view);
		case ProvideParticipationEditPart.VISUAL_ID:
			return getProvideParticipation_3010Text(view);
		case IncrementEconomicEventDualityEditPart.VISUAL_ID:
			return getIncrementEconomicEventDuality_3011Text(view);
		case IncrementEconomicEventTypeDualityTypeEditPart.VISUAL_ID:
			return getIncrementEconomicEventTypeDualityType_3012Text(view);
		case CommitmentAgentEditPart.VISUAL_ID:
			return getCommitmentAgent_3013Text(view);
		case CommitmentResourceEditPart.VISUAL_ID:
			return getCommitmentResource_3014Text(view);
		case IncrementCommitmentFulfillEditPart.VISUAL_ID:
			return getIncrementCommitmentFulfill_3015Text(view);
		case DecrementCommitmentFulfillEditPart.VISUAL_ID:
			return getDecrementCommitmentFulfill_3016Text(view);
		case IncrementCommitmentReciprocityEditPart.VISUAL_ID:
			return getIncrementCommitmentReciprocity_3017Text(view);
		case DecrementCommitmentSpecifyEditPart.VISUAL_ID:
			return getDecrementCommitmentSpecify_3018Text(view);
		case IncrementCommitmentSpecifyEditPart.VISUAL_ID:
			return getIncrementCommitmentSpecify_3019Text(view);
		}
		return getUnknownElementText(view);
	}

	/**
	 * @generated
	 */
	private String getREAModel_79Text(View view) {
		REAModel domainModelElement = (REAModel) view.getElement();
		if (domainModelElement != null) {
			return domainModelElement.getDescription();
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"No domain element for view with visualID = " + 79); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}
	}

	/**
	 * @generated
	 */
	private String getEconomicResourceType_1001Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.EconomicResourceType_1001, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(EconomicResourceTypeNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4001); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getEconomicAgentType_1002Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.EconomicAgentType_1002, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(EconomicAgentTypeNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4002); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getDecrementEconomicEventType_1003Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.DecrementEconomicEventType_1003,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(DecrementEconomicEventTypeNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4003); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementEconomicEventType_1004Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementEconomicEventType_1004,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(IncrementEconomicEventTypeNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4004); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getEconomicAgent_1005Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.EconomicAgent_1005,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(EconomicAgentNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4005); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getEconomicResource_1006Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.EconomicResource_1006, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(EconomicResourceNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4006); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getDecrementEconomicEvent_1007Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.DecrementEconomicEvent_1007, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(DecrementEconomicEventNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4007); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementEconomicEvent_1008Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementEconomicEvent_1008, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(IncrementEconomicEventNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4008); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementCommitment_1009Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementCommitment_1009, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(IncrementCommitmentNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4009); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getDecrementCommitment_1010Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.DecrementCommitment_1010, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(DecrementCommitmentNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4010); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getEconomicResourceTypeTypify_3001Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.EconomicResourceTypeTypify_3001, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(TypifyLabelEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getOutflow_3002Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.Outflow_3002,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(OutflowNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4012); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getInflow_3003Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.Inflow_3003,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(InflowNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4014); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getDecrementEconomicEventTypeTypify_3004Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.DecrementEconomicEventTypeTypify_3004,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(TypifyLabel2EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementEconomicEventTypeTypify_3005Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementEconomicEventTypeTypify_3005,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(TypifyLabel3EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getOutflowType_3006Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.OutflowType_3006,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(OutflowTypeNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4018); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getInflowType_3007Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.InflowType_3007,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(InflowTypeNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4020); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getEconomicAgentTypeTypify_3008Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.EconomicAgentTypeTypify_3008, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(TypifyLabel4EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getReceiveParticipation_3009Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.ReceiveParticipation_3009, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(ReceiveParticipationNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4023); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getProvideParticipation_3010Text(View view) {
		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.ProvideParticipation_3010, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(ProvideParticipationNameEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);

		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			REAmetamodelDiagramEditorPlugin.getInstance().logError(
					"Parser was not found for label " + 4025); //$NON-NLS-1$
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementEconomicEventDuality_3011Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementEconomicEventDuality_3011,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(DualityLabelEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementEconomicEventTypeDualityType_3012Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementEconomicEventTypeDualityType_3012,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(DualityTypeLabelEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getCommitmentAgent_3013Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.CommitmentAgent_3013, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(SpecifyLabelEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getCommitmentResource_3014Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.CommitmentResource_3014, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(SpecifyLabel2EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementCommitmentFulfill_3015Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementCommitmentFulfill_3015, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(FulfillLabelEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getDecrementCommitmentFulfill_3016Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.DecrementCommitmentFulfill_3016, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(FulfillLabel2EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementCommitmentReciprocity_3017Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementCommitmentReciprocity_3017,
				(view.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(ReciprocityLabelEditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getDecrementCommitmentSpecify_3018Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.DecrementCommitmentSpecify_3018, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(SpecifyLabel3EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getIncrementCommitmentSpecify_3019Text(View view) {

		IAdaptable hintAdapter = new REAmetamodelParserProvider.HintAdapter(
				REAmetamodelElementTypes.IncrementCommitmentSpecify_3019, (view
						.getElement() != null ? view.getElement() : view),
				REAmetamodelVisualIDRegistry
						.getType(SpecifyLabel4EditPart.VISUAL_ID));
		IParser parser = ParserService.getInstance().getParser(hintAdapter);
		if (parser != null) {
			return parser.getPrintString(hintAdapter, ParserOptions.NONE
					.intValue());
		} else {
			return ""; //$NON-NLS-1$
		}

	}

	/**
	 * @generated
	 */
	private String getUnknownElementText(View view) {
		return "<UnknownElement Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	private String getUnresolvedDomainElementProxyText(View view) {
		return "<Unresolved domain element Visual_ID = " + view.getType() + ">"; //$NON-NLS-1$ //$NON-NLS-2$
	}

	/**
	 * @generated
	 */
	public void init(ICommonContentExtensionSite aConfig) {
	}

	/**
	 * @generated
	 */
	public void restoreState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public void saveState(IMemento aMemento) {
	}

	/**
	 * @generated
	 */
	public String getDescription(Object anElement) {
		return null;
	}

	/**
	 * @generated
	 */
	private boolean isOwnView(View view) {
		return REAModelEditPart.MODEL_ID.equals(REAmetamodelVisualIDRegistry
				.getModelID(view));
	}

}
